package com.qin.mall.openfeign.product;

import com.qin.mall.common.api.CommonPage;
import com.qin.mall.common.api.CommonResult;
import com.qin.mall.domain.PmsProductAttribute;
import com.qin.mall.domain.PmsProductCategoryAttributeRelation;
import com.qin.mall.dto.ProductAttributeParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/** 
 * 产品属性
 * @author Leisure
 * create 2022 2022/11/19 10:27
 **/
@FeignClient("product-manage")
public interface ProductAttributeFeigin {

    //根据分类分页获取商品属性
    @GetMapping("/productAttribute/list$/{cid}")
    public CommonResult<CommonPage<PmsProductAttribute>> getListByType(@PathVariable Long cid,
                                                                       @RequestParam(value = "type") Integer type,
                                                                       @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);


    //添加商品属性
    @PostMapping("/productAttribute/create$")
    public CommonResult createAttribute(@RequestBody ProductAttributeParam productAttributeParam);

    //修改商品属性
    @PostMapping("/productAttribute/update$/{id}")
    public CommonResult updateAttribute(@PathVariable Long id, @RequestBody ProductAttributeParam productAttributeParam);
    
    // 获取单个商品属性信息
    @GetMapping("/productAttribute/$/{id}")
    public CommonResult<PmsProductAttribute> getAttributeById(@PathVariable Long id);

    //删除多个商品属性值
    @PostMapping("/productAttribute/delete$")
    public CommonResult deleteAttributeByIds(@RequestBody List<Long> ids);

    //根据分类获取商品属性信息
    @GetMapping("/productAttribute/attrInfo$/{productCategoryId}")
    public CommonResult<List<PmsProductCategoryAttributeRelation>> getProductAttrInfo(@PathVariable Long productCategoryId);

    


}